<?php

/**
 * content actions.
 *
 * @package    sfproject
 * @subpackage content
 * @author     Your name here
 */
class contentActions extends sfActions
{
  public function executeIndexStudent(sfWebRequest $request)
  {
    $this->AbetStudents = AbetStudentPeer::doSelect(new Criteria());
  }

  public function executeShowStudent(sfWebRequest $request)
  {
    $this->AbetStudent = AbetStudentPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetStudent);
  }

  public function executeNewStudent(sfWebRequest $request)
  {
    $this->form = new AbetStudentForm();
  }

  public function executeCreateStudent(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetStudentForm();

    $this->processFormStudent($request, $this->form);

    $this->setTemplate('newStudent');
  }

  public function executeEditStudent(sfWebRequest $request)
  {
    $this->forward404Unless($AbetStudent = AbetStudentPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetStudent does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetStudentForm($AbetStudent);
  }

  public function executeUpdateStudent(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetStudent = AbetStudentPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetStudent does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetStudentForm($AbetStudent);

    $this->processFormStudent($request, $this->form);

    $this->setTemplate('editStudent');
  }

  public function executeDeleteStudent(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetStudent = AbetStudentPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetStudent does not exist (%s).', $request->getParameter('id')));
    $AbetStudent->delete();

    $this->redirect('content/indexStudent');
  }

  protected function processFormStudent(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetStudent = $form->save();

      $this->redirect('content/editStudent?id='.$AbetStudent->getId());
    }
  }



////////////////////////////////////////////////////////////

 public function executeIndexDepartment(sfWebRequest $request)
  {
    $this->AbetDepartments = AbetDepartmentPeer::doSelect(new Criteria());
  }

  public function executeShowDepartment(sfWebRequest $request)
  {
    $this->AbetDepartment = AbetDepartmentPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetDepartment);
  }

  public function executeNewDepartment(sfWebRequest $request)
  {
    $this->form = new AbetDepartmentForm();
  }

  public function executeCreateDepartment(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetDepartmentForm();

    $this->processFormDepartment($request, $this->form);

    $this->setTemplate('newDepartment');
  }

  public function executeEditDepartment(sfWebRequest $request)
  {
    $this->forward404Unless($AbetDepartment = AbetDepartmentPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetDepartment does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetDepartmentForm($AbetDepartment);
  }

  public function executeUpdateDepartment(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetDepartment = AbetDepartmentPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetDepartment does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetDepartmentForm($AbetDepartment);

    $this->processFormDepartment($request, $this->form);

    $this->setTemplate('editDepartment');
  }

  public function executeDeleteDepartment(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetDepartment = AbetDepartmentPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetDepartment does not exist (%s).', $request->getParameter('id')));
    $AbetDepartment->delete();

    $this->redirect('content/indexDepartment');
  }

  protected function processFormDepartment(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetDepartment = $form->save();

      $this->redirect('content/editDepartment?id='.$AbetDepartment->getId());
    }
  }

///////////////////////////////////////////////////////

 public function executeIndexProjectList(sfWebRequest $request)
  {
    $this->AbetProjectLists = AbetProjectListPeer::doSelect(new Criteria());
  }

  public function executeShowProjectList(sfWebRequest $request)
  {
    $this->AbetProjectList = AbetProjectListPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetProjectList);
  }

  public function executeNewProjectList(sfWebRequest $request)
  {
    $this->form = new AbetProjectListForm();
  }

  public function executeCreateProjectList(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetProjectListForm();

    $this->processFormProjectList($request, $this->form);

    $this->setTemplate('newProjectList');
  }

  public function executeEditProjectList(sfWebRequest $request)
  {
    $this->forward404Unless($AbetProjectList = AbetProjectListPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProjectList does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetProjectListForm($AbetProjectList);
  }

  public function executeUpdateProjectList(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetProjectList = AbetProjectListPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProjectList does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetProjectListForm($AbetProjectList);

    $this->processFormProjectList($request, $this->form);

    $this->setTemplate('editProjectList');
  }

  public function executeDeleteProjectList(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetProjectList = AbetProjectListPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProjectList does not exist (%s).', $request->getParameter('id')));
    $AbetProjectList->delete();

    $this->redirect('content/indexProjectList');
  }

  protected function processFormProjectList(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetProjectList = $form->save();

      $this->redirect('content/editProjectList?id='.$AbetProjectList->getId());
    }
  }

////////////////////////////////////////////////////////

  public function executeIndexCollege(sfWebRequest $request)
  {
    $this->AbetColleges = AbetCollegePeer::doSelect(new Criteria());
  }

  public function executeShowCollege(sfWebRequest $request)
  {
    $this->AbetCollege = AbetCollegePeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetCollege);
  }

  public function executeNewCollege(sfWebRequest $request)
  {
    $this->form = new AbetCollegeForm();
  }

  public function executeCreateCollege(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetCollegeForm();

    $this->processFormCollege($request, $this->form);

    $this->setTemplate('newCollege');
  }

  public function executeEditCollege(sfWebRequest $request)
  {
    $this->forward404Unless($AbetCollege = AbetCollegePeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetCollege does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetCollegeForm($AbetCollege);
  }

  public function executeUpdateCollege(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetCollege = AbetCollegePeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetCollege does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetCollegeForm($AbetCollege);

    $this->processFormCollege($request, $this->form);

    $this->setTemplate('editCollege');
  }

  public function executeDeleteCollege(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetCollege = AbetCollegePeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetCollege does not exist (%s).', $request->getParameter('id')));
    $AbetCollege->delete();

    $this->redirect('content/indexCollege');
  }

  protected function processFormCollege(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetCollege = $form->save();

      $this->redirect('content/editCollege?id='.$AbetCollege->getId());
    }
  }

/////////////////////////////////////////////////////////////////////////

  public function executeIndexProjectDate(sfWebRequest $request)
  {
    $this->AbetProjectDates = AbetProjectDatePeer::doSelect(new Criteria());
  }

  public function executeShowProjectDate(sfWebRequest $request)
  {
    $this->AbetProjectDate = AbetProjectDatePeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetProjectDate);
  }

  public function executeNewProjectDate(sfWebRequest $request)
  {
    $this->form = new AbetProjectDateForm();
  }

  public function executeCreateProjectDate(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetProjectDateForm();

    $this->processFormProjectDate($request, $this->form);

    $this->setTemplate('newProjectDate');
  }

  public function executeEditProjectDate(sfWebRequest $request)
  {
    $this->forward404Unless($AbetProjectDate = AbetProjectDatePeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProjectDate does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetProjectDateForm($AbetProjectDate);
  }

  public function executeUpdateProjectDate(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetProjectDate = AbetProjectDatePeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProjectDate does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetProjectDateForm($AbetProjectDate);

    $this->processFormProjectDate($request, $this->form);

    $this->setTemplate('editProjectDate');
  }

  public function executeDeleteProjectDate(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetProjectDate = AbetProjectDatePeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProjectDate does not exist (%s).', $request->getParameter('id')));
    $AbetProjectDate->delete();

    $this->redirect('content/indexProjectDate');
  }

  protected function processFormProjectDate(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetProjectDate = $form->save();

      $this->redirect('content/editProjectDate?id='.$AbetProjectDate->getId());
    }
  }

///////////////////////////////////////////////////////////////

 public function executeIndexProject(sfWebRequest $request)
  {
    $this->AbetProjects = AbetProjectPeer::doSelect(new Criteria());
  }

  public function executeShowProject(sfWebRequest $request)
  {
    $this->AbetProject = AbetProjectPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetProject);
  }

  public function executeNewProject(sfWebRequest $request)
  {
    $this->form = new AbetProjectForm();
  }

  public function executeCreateProject(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetProjectForm();

    $this->processFormProject($request, $this->form);

    $this->setTemplate('newProject');
  }

  public function executeEditProject(sfWebRequest $request)
  {
    $this->forward404Unless($AbetProject = AbetProjectPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProject does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetProjectForm($AbetProject);
  }

  public function executeUpdateProject(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetProject = AbetProjectPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProject does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetProjectForm($AbetProject);

    $this->processFormProject($request, $this->form);

    $this->setTemplate('editProject');
  }

  public function executeDeleteProject(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetProject = AbetProjectPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetProject does not exist (%s).', $request->getParameter('id')));
    $AbetProject->delete();

    $this->redirect('content/indexProject');
  }

  protected function processFormProject(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetProject = $form->save();

      $this->redirect('content/editProject?id='.$AbetProject->getId());
    }
  }

////////////////////////////////////////////////////////

  public function executeIndexTeam(sfWebRequest $request)
  {
    $this->AbetTeams = AbetTeamPeer::doSelect(new Criteria());
  }

  public function executeShowTeam(sfWebRequest $request)
  {
    $this->AbetTeam = AbetTeamPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetTeam);
  }

  public function executeNewTeam(sfWebRequest $request)
  {
    $this->form = new AbetTeamForm();
  }

  public function executeCreateTeam(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetTeamForm();

    $this->processFormTeam($request, $this->form);

    $this->setTemplate('newTeam');
  }

  public function executeEditTeam(sfWebRequest $request)
  {
    $this->forward404Unless($AbetTeam = AbetTeamPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetTeam does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetTeamForm($AbetTeam);
  }

  public function executeUpdateTeam(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetTeam = AbetTeamPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetTeam does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetTeamForm($AbetTeam);

    $this->processFormTeam($request, $this->form);

    $this->setTemplate('editTeam');
  }

  public function executeDeleteTeam(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetTeam = AbetTeamPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetTeam does not exist (%s).', $request->getParameter('id')));
    $AbetTeam->delete();

    $this->redirect('content/index');
  }

  protected function processFormTeam(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetTeam = $form->save();

      $this->redirect('content/editTeam?id='.$AbetTeam->getId());
    }
  }

////////////////////////////////////////////////////////////////

  public function executeIndexInstructor(sfWebRequest $request)
  {
    $this->AbetInstructors = AbetInstructorPeer::doSelect(new Criteria());
  }

  public function executeShowInstructor(sfWebRequest $request)
  {
    $this->AbetInstructor = AbetInstructorPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->AbetInstructor);
  }

  public function executeNewInstructor(sfWebRequest $request)
  {
    $this->form = new AbetInstructorForm();
  }

  public function executeCreateInstructor(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new AbetInstructorForm();

    $this->processFormInstructor($request, $this->form);

    $this->setTemplate('newInstructor');
  }

  public function executeEditInstructor(sfWebRequest $request)
  {
    $this->forward404Unless($AbetInstructor = AbetInstructorPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetInstructor does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetInstructorForm($AbetInstructor);
  }

  public function executeUpdateInstructor(sfWebRequest $request)
  {
    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
    $this->forward404Unless($AbetInstructor = AbetInstructorPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetInstructor does not exist (%s).', $request->getParameter('id')));
    $this->form = new AbetInstructorForm($AbetInstructor);

    $this->processFormInstructor($request, $this->form);

    $this->setTemplate('editInstructor');
  }

  public function executeDeleteInstructor(sfWebRequest $request)
  {
    $request->checkCSRFProtection();

    $this->forward404Unless($AbetInstructor = AbetInstructorPeer::retrieveByPk($request->getParameter('id')), sprintf('Object AbetInstructor does not exist (%s).', $request->getParameter('id')));
    $AbetInstructor->delete();

    $this->redirect('content/indexInstructor');
  }

  protected function processFormInstructor(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $AbetInstructor = $form->save();

      $this->redirect('content/editInstructor?id='.$AbetInstructor->getId());
    }
  }
}
